package com.ruoyi;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;

/**
 * 启动程序
 *
 * @author ruoyi
 */
@Slf4j
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class RuoYiApplication {
    public static void main(String[] args) {
        try {
            ConfigurableApplicationContext application = SpringApplication.run(RuoYiApplication.class, args);
            System.out.println("(♥◠‿◠)ﾉﾞ  RuoYiApplication启动成功   ლ(´ڡ`ლ)ﾞ  \n");
            Environment env = application.getEnvironment();
            String ip = InetAddress.getLocalHost().getHostAddress();
            String port = env.getProperty("server.port");
            String path = env.getProperty("server.servlet.context-path");
            path = path == null ? "" : path;
            log.info("-------------44444444444444444444444-----------------");
            log.info("\n------------------接口文档----------------------\n\t" +
                    "Application ManageApi is running! Access URLs:\n\t" +
                    "Swagger文档: \thttp://" + ip + ":" + port + path + "swagger-ui/index.html\n" +
                    "Swagger2文档: \thttp://" + ip + ":" + port + path + "doc.html#/home\n" +
                    "----------------------------------------------------------");
        } catch (Exception e) {
        }
    }
}
